package com.mm.cloud.lease.service;

import com.mm.cloud.common.core.result.Result;
import com.mm.cloud.lease.dto.housing.form.DeleteHousingDTO;
import com.mm.cloud.lease.dto.housing.form.SaveHousingDTO;
import com.mm.cloud.lease.dto.housing.form.UpdateHousingDTO;
import com.mm.cloud.lease.dto.housing.query.QueryHousingDTO;
import com.mm.cloud.lease.entity.Housing;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mm.cloud.lease.vo.housing.HousingPageVO;
import com.mm.cloud.lease.vo.housing.HousingVO;
import jakarta.validation.constraints.NotNull;

import java.util.List;

/**
 * <p>
 * 房源 服务类
 * </p>
 *
 * @author mr
 * @since 2025-06-30
 */
public interface IHousingService extends IService<Housing> {

    /**
     * 新增房源
     *
     * @param dto
     * @return
     */
    Result<Long> saveHousing(SaveHousingDTO dto);

    /**
     * 修改房源
     *
     * @param dto
     * @return
     */
    Result<String> updateHousing(UpdateHousingDTO dto);

    /**
     * 删除房源
     *
     * @param dto
     * @return
     */
    Result<String> deleteHousing(DeleteHousingDTO dto);

    /**
     * 获取房源
     *
     * @param id
     * @return
     */
    Result<HousingVO> getHousing(@NotNull(message = "主键id不能为空") Long id);

    /**
     * 获取房源列表
     *
     * @param dto
     * @return
     */
    Result<List<HousingPageVO>> getHousingList(QueryHousingDTO dto);
}
